package day05;

import java.util.Arrays;
import java.util.Scanner;

public class Exercise_day05 {
    public static void main(String[] args) {

        int[]arr=new int[10];
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        Arrays.sort(arr);
        System.out.println("排序后:");
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        System.out.println("反向输出:");
        for (int i =arr.length-1;i>=0;i++){
            System.out.println(arr[i]);
        }
        System.out.println("正反顺序输出第一个元素均是:"+arr[0]);

        /*
        int[]a=new int[5];
        double[]b=new double[5];
        boolean[]c=new boolean[5];
        int[]arr=new int[3];
        int[]arr1={100,200,300};
        int[]arr2=new int[]{100,200,300};
        arr[0]=100;
        arr[1]=200;
        arr[2]=300;
        arr[3]=400;
        System.out.println(arr[0]);
        System.out.println(arr[arr.length]);
        int[]d=new int[10];
        for (int i=0;i<d.length;i++){
            d[i]=(int)(Math.random()*100);
            System.out.println(d[i]);
        }

         */

        /*
        for (int num =1;num<=9;num++){
            for (int i=1;i<=num;i++){
                System.out.print(i+"*"+num+"="+i*num+"\t");
            }
            System.out.println();
        }

         */

        /*
        Scanner scan = new Scanner(System.in);
        int score=0;
        for (int i =0;i<=10;i++){
            int a=(int)(Math.random()*100);
            int b=(int)(Math.random()*100);
            int result=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧!");
            int answer=scan.nextInt();
            if (answer==result){
                System.out.println("答对了!");
                score +=10;
            }else {
                System.out.println("答错了!");
            }
        }
        System.out.println("你的总成绩是:"+score+"分!");

         */
        /*
        int[]arr=new int[10];
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        Arrays.sort(arr);
        System.out.println("排序后:");
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        System.out.println("反向输出:");
        for (int i =arr.length-1;i>=0;i++){
            System.out.println(arr[i]);
        }
        System.out.println("正反顺序输出第一个元素均是:"+arr[0]);

         */

        /*
        int[]arr =new int[3];
        for (int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }
        int max=arr[0];
        for (int i=1;i<arr.length;i++){
            if (arr[i]>max){
                max=arr[i];
            }
        }
        System.out.println("max最大值是:"+max);

         */

        /*
        int[]a=new int[5];
        double[]b=new double[5];
        boolean[]c=new boolean[5];
        int[]arr=new int[3];
        int[]arr1={100,200,300};
        int[]arr2=new int[]{100,200,300};
        arr[0]=100;
        arr[1]=200;
        arr[2]=300;
        arr[3]=400;
        System.out.println(arr[0]);
        System.out.println(arr[arr.length]);
        int[]d=new int[10];
        for (int i=0;i<d.length;i++){
            d[i]=(int)(Math.random()*100);
            System.out.println(d[i]);
        }

         */

        /*
        for (int num =1;num<=9;num++){
            for (int i=1;i<=num;i++){
                System.out.print(i+"*"+num+"="+i*num+"\t");
            }
            System.out.println();
        }

         */

        /*
        Scanner scan = new Scanner(System.in);
        int score=0;
        for (int i =0;i<=10;i++){
            int a=(int)(Math.random()*100);
            int b=(int)(Math.random()*100);
            int result=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧!");
            int answer=scan.nextInt();
            if (answer==result){
                System.out.println("答对了!");
                score +=10;
            }else {
                System.out.println("答错了!");
            }
        }
        System.out.println("你的总成绩是:"+score+"分!");

         */
    }
}




